package cn.jtcoding.xhs.controller;

import cn.jtcoding.xhs.model.vo.CategoryVO;
import cn.jtcoding.xhs.service.CategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author jason.tang
 * @Date 2020/8/4 19:54
 * @Desc
 */

@Api(tags = "分类")
@RestController
@RequestMapping("/categories")
public class CategoryController {

    @Autowired
    private CategoryService categoryService;

    @ApiOperation(value = "获取全部分类", notes = "获取全部分类")
    @GetMapping("")
    public List<CategoryVO> getCategoryList() {
        return categoryService.getCategoryList();
    }
}
